{include file="pageheader_erp.htm"}


{insert_scripts files="../js/jquery.1.3.2.js"}
{insert_scripts files="../js/jquery.blockUI.2.23.js"}

<script language="JavaScript">
	$(document).ready(function(){
		$("span[id^='order_sn_']").css('cursor','pointer');
		$("span[id^='order_sn_']").mouseover(function(){
			$(this).css('color','red');
		});
		$("span[id^='order_sn_']").mouseout(function(){
			$(this).css('color','black');
		});	
		$("span[id^='order_sn_']").click(function(){
			var this_id=$(this).attr('id');
			var order_id=this_id.substr('order_sn_'.length,this_id.length-'order_sn_'.length);
			var open_url='order.php?act=info&order_id='+order_id;
			window.open(open_url,'_blank');	
		});	
		
		$("img[id^='img_goods_']").css('cursor','pointer');
		$("img[id^='img_goods_']").click(function(){
			var this_id=$(this).attr('id');
			var goods_id=this_id.substr('img_goods_'.length,this_id.length-'img_goods_'.length);	
			var open_url='/goods.php?id='+goods_id;	
			window.open(open_url,'_blank');		
		});
		
		
		
	});
	
	function gather()
	{
		var order_id={$receivable_info.order_id};
		var gather_amount={$receivable_info.receivable};
		
		if(confirm('{$lang.erp_gathering_sure_to_gather}'))
		{
			Ajax.call('erp_receivable.php?act=gather', 'order_id='+order_id+'&gather_amount='+gather_amount, gatherResponse, 'POST', 'JSON');
			}
		function gatherResponse(res)
		{
			if(res.error!=0)
			{
				alert(res.message);
			}
			else{
				window.document.location="./erp_finance_manage.php?act=gathering_list";
			}
		}
	}
	
</script>


<style type="text/css">

	
</style>

<script type="text/javascript">
	$(document).ready(function(){

		
		
	});
	
</script>

<!-- start receivable info -->

<div class="list-div" id="listDiv">
<table  cellpadding="3" cellspacing="1">
  <tr>
    <th width="15%">{$lang.erp_receivable_order_sn}</th>
	<th>{$lang.erp_receivable_order_username}</th>
	<th width="15%">{$lang.erp_receivable_order_shipping_date}</th>
	<th width="10%">{$lang.erp_receivable_order_amount}</th>
	<th width="10%">{$lang.erp_receivable_total_receivable_amount}</th>
	<th width="10%">{$lang.erp_receivable_total_gathered_amount}</th>
	<th width="10%">{$lang.erp_receivable_receivable}</th>
	{if $act eq 'edit'}
	<th width="10%">{$lang.erp_operation}</th>
  	{/if}
  </tr>

  <tr>
	<td align="center"><span id="order_sn_{$receivable_info.order_id}">{$receivable_info.order_sn}</span></td>
	<td align="center">{$receivable_info.username}</td>
	<td align="center">{$receivable_info.shipping_date}</td>
	<td align="center">{$receivable_info.money_paid}</td>
	<td align="center">{$receivable_info.receivable_amount}</td>
	<td align="center">{$receivable_info.gathered_amount}</td>
	<td align="center"><span style="{if $receivable_info.receivable gt 0}color:red;font-weight:bold;{else}color:blue;font-weight:bold;{/if}">{$receivable_info.receivable}</span></td>
	{if $act eq 'edit'}
	<td align="center">
		{if $act eq 'edit' and $receivable_info.receivable gt 0}<a href="javascript:gather()">{$lang.erp_receivable_operation_gather}</a>{/if}
	</td>
	{/if}
  </tr> 

</table>
</div>

<!-- end receivable info -->
<br/>


<!-- start receivable details-->
<div class="list-div" id="listDiv">
<table cellpadding="2" cellspacing="1">	
  <tr>
    <th width="6%">{$lang.erp_receivable_goods_id}</th>
 	<th width="150">{$lang.erp_receivable_goods_img}</th>
	<th>{$lang.erp_receivable_goods_sn}</th>
	<th>{$lang.erp_receivable_goods_attr}</th>
	<th>{$lang.erp_receivable_goods_price}</th>
	<th>{$lang.erp_receivable_goods_order_qty}</th>
	<th>{$lang.erp_receivable_goods_delivered_qty}</th>
	<th>{$lang.erp_receivable_goods_amount}</th>
  </tr>	

{foreach from=$receivable_info.order_goods key=key item=order_goods}
	<tr>
		<td align="center">{$order_goods.goods_id}</td>
		<td align="center"><img id="img_goods_{$order_goods.goods_id}" width="100" height="100" src="{$order_goods.goods_info.goods_thumb}"></td>
		<td align="center">{$order_goods.goods_sn}</td>
		<td align="center">{$order_goods.goods_attr}</td>
		<td align="center">{$order_goods.goods_price}</td>
		<td align="center">{$order_goods.goods_number}</td>
		<td align="center">{$order_goods.delivery_qty}</td>
		<td align="center">{$order_goods.goods_amount}</td>
	</tr>
 {foreachelse}
  <tr><td class="no-records" colspan="8">{$lang.no_records}</td></tr>
 {/foreach}
 	<tr>
		<td colspan="7" align="right"><span style="font-weight:bold;">{$lang.erp_sum}</span></td>
		<td align="center"><span style="font-weight:bold;">{$receivable_info.goods_amount}</span></td>
	</tr>	
</table>	
</div>

<!-- end receivable details -->

{literal}
<script language="JavaScript">
 
</script>
{/literal}
{include file="pagefooter.htm"}

